package com.sunnada.edu.business.setProcess.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;


@Repository
public class ProcessDaoImpl extends BaseDaoImpl implements ProcessDao {

	@Override
	public int getProcessInfoCots(HashMap<String, String> params) {
		List list = selectList("process_sqlmap.getProcessInfoCots", params);
		if(list!=null&&list.size()>0){
			String cot = ((Map)list.get(0)).get("COT")+"";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findProcessInfo(HashMap<String, String> params) {
		return selectList("process_sqlmap.findProcessInfo", params);
	}

	@Override
	public int processDel(HashMap<String, String> params) {
		return update("process_sqlmap.processDel", params);
	}

	@Override
	public int processAdd(HashMap<String, String> params) {
		return insert("process_sqlmap.processAdd",params);
	}

	@Override
	public int processUpdate(HashMap<String, String> params) {
		return update("process_sqlmap.processUpdate",params);
	}

	@Override
	public Map getProcessByRecId(HashMap<String, String> params) {
		List list = selectList("process_sqlmap.getProcessByRecId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);
		}
		return null;
	}

	@Override
	public List<HashMap<String, String>> judgeProcessUnique(
			HashMap<String, String> params) {
		return selectList("process_sqlmap.judgeProcessUnique", params);
	}

	@Override
	public List<?> getProcessList(HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessList", params);
	}

	@Override
	public List<?> getProcessPerson(HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessPerson", params);
	}

	@Override
	public int getProcessPersonCots(HashMap<String, String> params) {
		List list = selectList("process_sqlmap.getProcessPersonCots", params);
		if(list!=null&&list.size()>0){
			String cot = ((Map)list.get(0)).get("COT")+"";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public int insertProcess(HashMap<String, String> params) {
		return insert("process_sqlmap.insertProcess",params);
	}

	@Override
	public int updateProcess(HashMap<String, String> params) {
		return update("process_sqlmap.updateProcess", params);
	}

	@Override
	public int insertAuditPerson(List<HashMap<String, String>> list) {
		return insert("process_sqlmap.insertAuditPerson",list);
	}

	@Override
	public int deleteProcessInfo(HashMap<String, String> params) {
		return update("process_sqlmap.deleteProcessInfo", params);
	}

	@Override
	public int getProcessByName(HashMap<String, String> params) {
		List list = selectList("process_sqlmap.getProcessByName", params);
		return list.size();
	}

	@Override
	public List<?> getProcessInfo(HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessInfo", params);
	}

	@Override
	public int processInfoDel(HashMap<String, String> params) {
		return update("process_sqlmap.processInfoDel", params);
	}

	@Override
	public int addProcessStaff(List<HashMap<String, String>> list) {
		return insert("process_sqlmap.addProcessStaff",list);
	}

	@Override
	public int addProcessResult(Map<String, String> mapResult) {
		return insert("process_sqlmap.addProcessResult",mapResult);
	}

	@Override
	public int updateAuditState(HashMap<String, String> params) {
		return update("process_sqlmap.updateAuditState", params);
	}

	@Override
	public int updateViewFlag(HashMap<String, String> params) {
		return update("process_sqlmap.updateViewFlag", params);
	}

	@Override
	public int updateAuditResult(HashMap<String, String> params) {
		return update("process_sqlmap.updateAuditResult", params);
	}

	@Override
	public List<HashMap<String, String>> getProcessId(
			HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessId", params);
	}

	@Override
	public List<?> getProcessConditionByrecid(HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessConditionByrecid", params);
	}

	@Override
	public int reject(HashMap<String, String> params) {
		return update("process_sqlmap.reject", params);
	}

	@Override
	public Map getNoDealWithNumber(HashMap<String, String> params) {
		return selectOneMap("process_sqlmap.getNoDealWithNumber", params);
	}

	@Override
	public List<?> getProcessConditionByrecid1(HashMap<String, String> params) {
		return selectList("process_sqlmap.getProcessConditionByrecid1", params);
	}

}
